package com.yx.fsysserver.file.domain;

import java.util.Date;
import javax.persistence.*;

@Table(name = "t_file_info")
public class FileInfo {
    @Id
    private Long id;

    @Column(name = "request_id")
    private String requestId;

    private String code;

    private String message;

    @Column(name = "is_success")
    private Integer isSuccess;

    /**
     * 视频文件持续秒数
     */
    private Integer duration;

    @Column(name = "is_valid")
    private Integer isValid;

    @Column(name = "video_id")
    private String videoId;

    /**
     * 存储后文件名
     */
    private String name;

    /**
     * 源文件名
     */
    @Column(name = "src_name")
    private String srcName;

    /**
     * 文件大小 byte
     */
    private Long size;

    @Column(name = "sha1_code")
    private String sha1Code;

    @Column(name = "md5_code")
    private String md5Code;

    /**
     * 后缀名
     */
    private String suffix;

    /**
     * 预览路径
     */
    @Column(name = "path_view")
    private String pathView;

    /**
     * 文件标志符
     */
    @Transient
    private String uuid;

    /**
     * 存储的相对路径
     */
    private String path;

    private Date createtime;

    private String tmp;

    /**
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getIsSuccess() {
        return isSuccess;
    }

    public void setIsSuccess(Integer isSuccess) {
        this.isSuccess = isSuccess;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public String getVideoId() {
        return videoId;
    }

    public void setVideoId(String videoId) {
        this.videoId = videoId;
    }

    /**
     * 获取存储后文件名
     *
     * @return name - 存储后文件名
     */
    public String getName() {
        return name;
    }

    /**
     * 设置存储后文件名
     *
     * @param name 存储后文件名
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取源文件名
     *
     * @return src_name - 源文件名
     */
    public String getSrcName() {
        return srcName;
    }

    /**
     * 设置源文件名
     *
     * @param srcName 源文件名
     */
    public void setSrcName(String srcName) {
        this.srcName = srcName;
    }

    /**
     * 获取文件大小 byte
     *
     * @return size - 文件大小 byte
     */
    public Long getSize() {
        return size;
    }

    /**
     * 设置文件大小 byte
     *
     * @param size 文件大小 byte
     */
    public void setSize(Long size) {
        this.size = size;
    }

    /**
     * @return sha1_code
     */
    public String getSha1Code() {
        return sha1Code;
    }

    /**
     * @param sha1Code
     */
    public void setSha1Code(String sha1Code) {
        this.sha1Code = sha1Code;
    }

    /**
     * @return md5_code
     */
    public String getMd5Code() {
        return md5Code;
    }

    /**
     * @param md5Code
     */
    public void setMd5Code(String md5Code) {
        this.md5Code = md5Code;
    }

    /**
     * 获取后缀名
     *
     * @return suffix - 后缀名
     */
    public String getSuffix() {
        return suffix;
    }

    /**
     * 设置后缀名
     *
     * @param suffix 后缀名
     */
    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    /**
     * 获取预览路径
     *
     * @return path_view - 预览路径
     */
    public String getPathView() {
        return pathView;
    }

    /**
     * 设置预览路径
     *
     * @param pathView 预览路径
     */
    public void setPathView(String pathView) {
        this.pathView = pathView;
    }

    /**
     * 获取存储的相对路径
     *
     * @return path - 存储的相对路径
     */
    public String getPath() {
        return path;
    }

    /**
     * 设置存储的相对路径
     *
     * @param path 存储的相对路径
     */
    public void setPath(String path) {
        this.path = path;
    }

    /**
     * @return createtime
     */
    public Date getCreatetime() {
        return createtime;
    }

    /**
     * @param createtime
     */
    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    /**
     * @return tmp
     */
    public String getTmp() {
        return tmp;
    }

    /**
     * @param tmp
     */
    public void setTmp(String tmp) {
        this.tmp = tmp;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof FileInfo){
            FileInfo fileInfo = (FileInfo)obj;
            return this.getId().equals(fileInfo.getId());
        }else{
            return false;
        }

    }

    @Override
    public int hashCode() {
        return this.id.hashCode();
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }
}